var reviveCount = 5;
var mapIds = [701220700];
var 准备地图 = 701220500;

function init() {}

function setup(c, a) {
    em.setProperty("leader", "true");
    em.setProperty("state", "1");
    var c = em.newInstance("Boss_少林寺_玄慈方丈_普通");
    for (var b = 0; b < mapIds.length; b++) {
        var e = c.setInstanceMap(mapIds[b]);
        e.resetFully();
        e.killAllMonsters(false)
    }
    var d = em.getMonster(9601068);
    e.spawnMonsterOnGroundBelow(d, new java.awt.Point(751, 212));
    c.startEventTimer(15 * 60 * 1000);
    return c
}

function onPlayerRegistered(b, a) {
    var c = b.getMapInstance(0);
    a.changeMap(c, c.getPortal(0));
    c.startSimpleMapEffect("你将成为证明我力量的第一个牺牲品!", 5120161)
}

function onPlayerRevived(b, a) {
    if (a.getReviveCount() > 0) {
        var c = a.getMap();
        a.eventRevive();
        a.changeMap(c, c.getPortal(0));
        return true
    }
    var c = b.getMapFactoryMap(mapIds[1]);
    a.changeMap(c, c.getPortal(0));
    return true
}

function onTimeOut(a) {
    a.disposeIfPlayerBelow(100, 准备地图);
    em.setProperty("state", "0");
    em.setProperty("leader", "true")
}

function onMapChanged(c, b, a) {
    if (mapIds.indexOf(a) < 0) {
        c.unregisterPlayer(b);
        if (c.disposeIfPlayerBelow(0, 0)) {
            em.setProperty("state", "0");
            em.setProperty("leader", "true")
        }
    }
}

function onPlayerDisconnected(b, a) {
    return 0
}

function onMonsterKilled(a, b) {
    if (b == 9601068) {
        a.getPlayers().forEach(function (c) {
            c.getAPI().addNumberForQuestInfo(9601068, "kill", 1);
            a.startEventTimer(5 * 60 * 1000)
        })
    }
    return 1
}

function onPartyDisbanded(a) {}

function onPlayerKilled(b, a) {}

function onItemPickedUp(b, a, c) {};